package com.ctl.szmd.szmd.feature_wm.data.mapper.wm

import com.ctl.szmd.szmd.feature_wm.data.bean.WmDataBean
import com.ctl.szmd.szmd.feature_wm.data.mapper.Mapper
import com.ctl.szmd.szmd.feature_wm.data.model.WmDataModel

/**
 * created by : chentl
 * Date: 2020/07/30
 */

class WmDataBean2WmDataModel :
    Mapper<WmDataBean, WmDataModel> {
    override fun map(input: WmDataBean?): WmDataModel? {
        if (input != null) {
            return WmDataModel(
                code = input.ResCode,
                msg = input.ResMsg,

                token = input.Token,
                currentPage = input.CurrentPage,
                pageSize = input.PageSize,
                pageAllCount = input.NCount,

                flowerTotalCount = input.FlowerTotalCount,
                formatTotalPointSum = input.FormatTotalPointSum,
                portraitNetPath = input.PortraitNetPath,
                realName = input.RealName,
                userId = input.UId,

                dataList = ListCommonInfoForApiList2WmDataListModel().map(input.CommonInfoForApiList),

                attachmentList = ListAttachment2WmDataListModel().map(input.CommonInfoForApiDetail),

                fulianAppIndexIntro = input.IntroContentInfoForDetailForApi?.BodyHtml


            )
        }
        return null
    }
}